home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / utilities / easyproc2.lha / EasyProcess / launch / KillProc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-05  |  780 b   |  44 lines

  1. #include "Launch.h"
  2. #include "LaunchPriv.h"
  3.  
  4. /*
  5.  *    NAME
  6.  *        KillProcess -- try to kill a process via a signal.
  7.  *
  8.  *    SYNOPSIS
  9.  *        KillProcess (Proc)
  10.  *
  11.  *        void KillProcess (struct Process *);
  12.  *
  13.  *    DESCRIPTION
  14.  *        Send a KILL_PROCESS_FLAG signal to the process.
  15.  *
  16.  *    INPUT
  17.  *        Proc - the process to be killed.
  18.  *
  19.  *    OUTPUT
  20.  *        None.
  21.  *
  22.  *    NOTE
  23.  *        You DON'T need to be the parent to call this.
  24.  *
  25.  *        This function does not wait to see if the process really dies,
  26.  *        you MUST call WaitProcesses() before quitting !!!
  27.  *
  28.  *    HISTORY
  29.  *        1992/09/06    Pierre Baillargeon        Creation
  30.  *
  31.  *    SEE ALSO
  32.  *        StartProcess(), WaitProcesses(), WaitProcess()
  33.  */
  34.  
  35. void KillProcess (struct Process *Proc)
  36. {
  37.     Forbid ();
  38.     if (IsChild (Proc))
  39.     {
  40.         Signal (Proc, KILL_PROCESS_FLAG);
  41.     }
  42.     Permit ();
  43. }
  44.